import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "首页",
    redirect: "/index/index",
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/index/index.vue")
  },
  {
    path: "/index/index",
    name: "首页",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/index/index.vue")
  },
  {
    path: "/product/product",
    name: "产品",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/product/product.vue")
  },
  {
    path: "/industry/industry",
    name: "行业资讯",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/industry/industry.vue")
  },
  {
    path: "/industry/detail",
    name: "资讯详情",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/industry/detail.vue")
  },
  {
    path: "/about/about",
    name: "关于我们",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/about/about.vue")
  }
];

const router = new VueRouter({
  routes
});

export default router;
